#-*-encoding=utf-8-*-
steps = [
    FlowStep(
        name=u'init',
        title=u'申请',
        fields=[u'doc', u'description'],
        responsibles=u"sheet is None and [request.principal.id] or sheet['creators']",
    actions=[
        FlowStepAction(
            name=u'submit',
            title=u'提交',
            nextsteps=[u'review'],
            finish_condition=u''
)
])
,

    FlowStep(
        name=u'review',
        title=u'审核',
        fields=[u'persons'],
        responsibles=u'flowsettings["reviewer"]',
    actions=[
        FlowStepAction(
            name=u'accept',
            title=u'通过',
            nextsteps=[u'end'],
            finish_condition=u''
),

        FlowStepAction(
            name=u'reject',
            title=u'打回',
            nextsteps=[u'init'],
            finish_condition=u''
)
])
,

    FlowStep(
        name=u'end',
        title=u'收回',
        fields=[],
        responsibles=u'flowsettings["stuff"]',
    actions=[
        FlowStepAction(
            name=u'687633',
            title=u'完成',
            nextsteps=[],
            trigger=ur"""# 分发潘丹
for docid in sheet['doc']:
    doc = intids.getObject(docid)

    holders = IFieldStorage(doc).get('isodoc_holders', [])[:]
    for pid in sheet['persons']:
        if pid in holders:
            holders.remove(pid)
    IFieldStorage(doc)['isodoc_holders'] = holders
"""
)
])
]
